﻿using HT.Framework;
using UnityEngine;

/// <summary>
/// 登录流程
/// </summary>
public class ProcedureLogin : ProcedureBase
{
    /// <summary>
    /// 流程初始化
    /// </summary>
    public override void OnInit()
    {
#if UNITY_EDITOR
        string bPath = Application.dataPath.Replace("Assets", "Builds/AssetBundles/WebGL/");
        Main.m_Resource.SetAssetBundlePath(bPath);
#else
    Main.m_Resource.SetAssetBundlePath("http://localhost:5500/AssetBundles/WebGL/");
#endif
    }

    /// <summary>
    /// 进入流程
    /// </summary>
    /// <param name="lastProcedure">上一个离开的流程</param>
    public override void OnEnter(ProcedureBase lastProcedure)
    {
        Main.m_UI.OpenUI<UILogin>();
    }

    /// <summary>
    /// 离开流程
    /// </summary>
    /// <param name="nextProcedure">下一个进入的流程</param>
    public override void OnLeave(ProcedureBase nextProcedure)
    {
        Main.m_UI.CloseUI<UILogin>();
    }

    /// <summary>
    /// 流程帧刷新
    /// </summary>
    public override void OnUpdate()
    {
    }

    /// <summary>
    /// 流程帧刷新（秒）
    /// </summary>
    public override void OnUpdateSecond()
    {
    }
}
